package cn.edu.tju.elm.repository;

import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import cn.edu.tju.elm.model.Order;

@Repository
public interface OrderRepository extends JpaRepository<Order, Long> {
    
    /**
     * 根据顾客ID查询其所有订单
     */
    List<Order> findByCustomer_IdAndDeletedIsFalseOrderByOrderDateDesc(Long customerId);
    
    /**
     * 根据商家ID查询其所有订单
     */
    List<Order> findByBusiness_IdAndDeletedIsFalseOrderByOrderDateDesc(Long businessId);
}
